package cascade.view
{
	import cascade.model.Page;
	import cascade.model.Revision;
	
	import flight.mvc.BindableState;
	
	import mx.controls.HTML;
	
	[Bindable]
	dynamic public class CascadeView extends BindableState
	{
		public var debug:Boolean = false;
		public var browser:HTML;
		public var busy:Boolean;
		public var selectedPage:Page;
		public var currentURL:String;
		public var editingPage:Page;
		public var editing:Boolean;
		public var columnWidth:Number;
		public var draftMode:Boolean = true;
		
		public function get selectedRevision():Revision
		{
			if (!selectedPage)
				return null;
			
			return draftMode ? selectedPage.draftRevision : selectedPage.liveRevision;
		}
	}
}